home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / return.n < prev    next >
Encoding:
Text File  |  1995-07-26  |  6.3 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      rrrreeeettttuuuurrrrnnnn((((nnnn))))                   TTTTccccllll ((((7777....0000))))                   rrrreeeettttuuuurrrrnnnn((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           return - Return from a procedure
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           rrrreeeettttuuuurrrrnnnn ?----ccccooooddddeeee  _c_o_d_e?  ?----eeeerrrrrrrroooorrrriiiinnnnffffoooo  _i_n_f_o?  ?----eeeerrrrrrrroooorrrrccccooooddddeeee  _c_o_d_e?
  15.           ?_s_t_r_i_n_g?
  16.      _________________________________________________________________
  17.  
  18.  
  19.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.           Return immediately from the current procedure (or  top-level
  21.           command or ssssoooouuuurrrrcccceeee command), with _s_t_r_i_n_g as the return value.
  22.           If _s_t_r_i_n_g is not specified then  an  empty  string  will  be
  23.           returned as result.
  24.  
  25.  
  26.      EEEEXXXXCCCCEEEEPPPPTTTTIIIIOOOONNNNAAAALLLL RRRREEEETTTTUUUURRRRNNNNSSSS
  27.           In the usual case where the ----ccccooooddddeeee option isn't specified the  |
  28.           procedure  will return normally (its completion code will be  |
  29.           TCL_OK).  However, the ----ccccooooddddeeee option may be used to  generate  |
  30.           an exceptional return from the procedure.  _C_o_d_e may have any  |
  31.           of the following values:                                      |
  32.  
  33.           ooookkkk                                                                 ||
  34.                     Normal return:  same as if the option is omitted.   |
  35.  
  36.           eeeerrrrrrrroooorrrr                                                              ||
  37.                     Error  return:  same  as if the eeeerrrrrrrroooorrrr command were  |
  38.                     used  to  terminate  the  procedure,  except   for  |
  39.                     handling of eeeerrrrrrrroooorrrrIIIInnnnffffoooo and eeeerrrrrrrroooorrrrCCCCooooddddeeee variables (see  |
  40.                     below).                                             |
  41.  
  42.           rrrreeeettttuuuurrrrnnnn                                                             ||
  43.                     The   current   procedure   will   return  with  a  |
  44.                     completion  code  of  TCL_RETURN,  so   that   the  |
  45.                     procedure that invoked it will return also.         |
  46.  
  47.           bbbbrrrreeeeaaaakkkk                                                              ||
  48.                     The   current   procedure   will   return  with  a  |
  49.                     completion code of TCL_BREAK, which will terminate  |
  50.                     the innermost nested loop in the code that invoked  |
  51.                     the current procedure.                              |
  52.  
  53.           ccccoooonnnnttttiiiinnnnuuuueeee                                                           ||
  54.                     The   current   procedure   will   return  with  a  |
  55.                     completion  code  of  TCL_CONTINUE,   which   will  |
  56.                     terminate  the  current iteration of the innermost  |
  57.                     nested loop in the code that invoked  the  current  |
  58.                     procedure.                                          |
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/17/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      rrrreeeettttuuuurrrrnnnn((((nnnn))))                   TTTTccccllll ((((7777....0000))))                   rrrreeeettttuuuurrrrnnnn((((nnnn))))
  71.  
  72.  
  73.  
  74.           _v_a_l_u_e                                                              ||
  75.                     _V_a_l_u_e  must be an integer;  it will be returned as  |
  76.                     the completion code for the current procedure.      |
  77.  
  78.           The ----ccccooooddddeeee option is rarely used.  It  is  provided  so  that  |
  79.           procedures that implement new control structures can reflect  |
  80.           exceptional conditions back to their callers.                 |
  81.  
  82.           Two additional options, ----eeeerrrrrrrroooorrrriiiinnnnffffoooo and  ----eeeerrrrrrrroooorrrrccccooooddddeeee,  may  be  |
  83.           used to provide additional information during error returns.  |
  84.           These options are ignored unless _c_o_d_e is eeeerrrrrrrroooorrrr.               |
  85.  
  86.           The ----eeeerrrrrrrroooorrrriiiinnnnffffoooo option specifies an initial stack  trace  for  |
  87.           the  eeeerrrrrrrroooorrrrIIIInnnnffffoooo  variable;   if  it is not specified then the  |
  88.           stack trace left in eeeerrrrrrrroooorrrrIIIInnnnffffoooo will include the call  to  the  |
  89.           procedure  and  higher  levels  on the stack but it will not  |
  90.           include any information  about  the  context  of  the  error  |
  91.           within  the procedure.  Typically the _i_n_f_o value is supplied  |
  92.           from the value left  in  eeeerrrrrrrroooorrrrIIIInnnnffffoooo  after  a  ccccaaaattttcccchhhh  command  |
  93.           trapped an error within the procedure.                        |
  94.  
  95.           If the ----eeeerrrrrrrroooorrrrccccooooddddeeee option is specified then _c_o_d_e  provides  a  |
  96.           value  for  the  eeeerrrrrrrroooorrrrCCCCooooddddeeee  variable.   If the option is not  |
  97.           specified then eeeerrrrrrrroooorrrrCCCCooooddddeeee will default to NNNNOOOONNNNEEEE.
  98.  
  99.  
  100.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  101.           break, continue, error, procedure, return
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/17/95)
  130.  
  131.  
  132.  
  133.